package com.bci.pwtz.mysql.dao;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.bci.pwtz.mysql.model.Company;

public interface CompanyMapper {
    int deleteByPrimaryKey(Long companyId);

    int insert(Company record);

    int insertSelective(Company record);

    Company selectByPrimaryKey(Long companyId);

    int updateByPrimaryKeySelective(Company record);

    int updateByPrimaryKey(Company record);
    
    List<Long> selectChildrensId(@Param("companyId")Long companyId,@Param("userId")Long userId);
    
    List<Company> findCompanyByUserId(@Param("userId")Long userId);
    
    int deleteById(@Param("companyId")Long companyId);
    
    List<Company> selectCompany(@Param("companyName") String companyName,
            @Param("benginIndex") int benginIndex, @Param("pageSize") int pageSize);

    int selectCompanyNum(@Param("companyName") String companyName);
    
    int selectCreateCompanyNumByUserId(@Param("userId")Long userId);
    
    List<Company> selectCompanyPageByUserId(@Param("userId") Long userId,
            @Param("benginIndex") int benginIndex, @Param("pageSize") int pageSize);

    int selectCountCompanyPageByUserId(@Param("userId") Long userId);
    
    List<Company> findMyCompany(Long userId);
    
    List<Company> findChildrens(@Param("ids")String[] ids);
    
    Company selectCompanyInfo(@Param("companyId")Long companyId);
    
    int selectCount(@Param("pid")Long pid,@Param("name")String name);
    
    List<Company> findCompanyList(@Param("company")Company company, @Param("beginTime")String beginTime,
    		@Param("endTime")String endTime,
    		@Param("benginIndex") int benginIndex, @Param("pageSize") int pageSize);

    int findCompanyCount(@Param("company")Company company, @Param("beginTime")String beginTime,
    		@Param("endTime")String endTime);
    int approvePay(@Param("id")Long id,@Param("invalidTime")Date invalidTime);
    
    void updateVipExpireStatus();
    
    int selectVip(@Param("companyId")Long companyId);
    
    List<Company> selectcCompanyStatistics(@Param("provinceCode")String provinceCode,@Param("cityCode")String cityCode, @Param("beginTime")String beginTime,
            @Param("endTime")String endTime);
}